/**
 * 用户相关的ajax函数
*/
import axios from "@/utils/request";

//登录
export const checkLogin=(data)=>{
    return axios({
        url:'/users/checkLogin',
        method:'post',
        data
    })
}

//添加账号
export const addAccount =(data)=>{
    return axios({
        url:'/users/add',
        method:'post',
        data
    })
}

//获取账号列表
export const getAccount = (params) =>{
    return axios({
        url:'/users/list',
        method:'get',
        params
    })
}

//删除账号
export const delAccount =(params)=>{
    return axios({
        url:'/users/del',
        method:'get',
        params
    })
}

//修改账户
export const aditAccount =(data)=>{
    return axios({
        url:'/users/edit',
        method:'post',
        data
    })
}

//批量删账户
export const batchDelAccount =(data)=>{
    return axios({
        url:'/users/batchdel',
        method:'post',
        data
    })
}

//检测原密码是否正确
export const validateOldPwd = (params) =>{
    return axios({
        url:'/users/checkoldpwd',
        method:'get',
        params
    })

    
}

//修改密码
export const updatePwd = (data) =>{
    
    return axios({
        url:'/users/editpwd',
        method:'post',
        data
    })
}

//获取个人信息
export const getUserInfo = (params)=>{
    return axios({
        url:'/users/info',
        method:'get',
        params
    })
}

// 修改用户头像接口
export const usersAvataredit = (params)=>{
    return axios({
        url:'/users/avataredit',
        method:'get',
        params
    })
}